//脚本加载函数
function scriptLoad(src, cb) {
    let script = document.createElement('script');
    script.src = src;
    document.head.append(script);
    script.onload = function () {
        cb()
    }
};
//头部滚动固定
window.onscroll = function () {
    if ($('.header').outerHeight() < window.pageYOffset) {
        $('.header').css('top', window.pageYOffset)
    } else {
        $('.header').css('top', 0)
    }
}


scriptLoad('https://cdn.bootcdn.net/ajax/libs/wow/1.1.2/wow.min.js', function () {
    new WOW().init();
    console.log(WOW)
})
$('.header .box').on('click', function () {
    if ($(this).hasClass('active')) {
        $(this)
            .removeClass('active')
            .addClass('close');
        $('.header .nav').fadeOut();
        document.body.style.overflow = 'hidden'
        document.body.style.overflow = ''
        document.body.style.width = '100%'
    } else {

        $(this)
            .removeClass('close')
            .addClass('active');
        $('.header .nav').fadeIn()
    }

})